<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="__PUBLIC__/easyui/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/easyui/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/easyui/themes/gray/easyui.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/easyui/themes/icon.css">
<link rel="stylesheet" href="__PUBLIC__/js/kindeditor/themes/default/default.css" />
<script src="__PUBLIC__/js/kindeditor/kindeditor-min.js"></script>
<script src="__PUBLIC__/js/kindeditor/lang/zh_CN.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/add-tab.js"></script>

<script type="text/javascript">
	$(function(){
			$('#addleavefrm').form({
				url:'__APP__/Process/doApproval',
			    onSubmit:function(){
			        return $(this).form('validate');
			    },
			    success:function(data){
			    	$.messager.alert('提示', data, 'info');
			    }

			});


			//消息催促
			$('#msgUrge').click(function(){
				var msg_to=$("#msg_to").val();
				var msg_title=$("#msg_title").val();
				var msg_content=$("#msg_content").val();
				var process_num=$(".process_num").val();
				$.ajax({
					type:'post',
					url:'__APP__/Message/sendMsgHtml',
					data:{msg_to:msg_to,msg_title:msg_title,msg_content:msg_content,process_num:process_num},
					success:function(data){
						if(data=='ok'){
							$.messager.alert('提示', '发送成功', 'info');
						}
						if(data=='no'){
							$.messager.alert('提示', '发送失败', 'info');
						}
						if(data=='later'){
							$.messager.alert('提示','消息已发送，请在半小时后再发送！','info');
						}
					}
				})
			})

			//短信催促
			$('#msmUrge').click(function(){
				var employe_phone=$("#employe_phone").val();
				var msg_title=$("#msg_title").val();
				var msg_content=$("#msg_content").val();
				var process_num=$(".process_num").val();
				$.ajax({
					type:'post',
					url:'__APP__/Message/sendSMSHtml',
					data:{employe_phone:employe_phone,msg_title:msg_title,msg_content:msg_content,process_num:process_num},
					success:function(data){
						if(data=='later'){
							$.messager.alert('提示','短信已发送，请在半小时后再发送！','info');
						}
						else{
							$.messager.alert('提示',data,'info');
						}
						
					}
				})
			})
		})
	/*设置文本编辑器*/
	var editor;
	KindEditor.ready(function(K) {
		editor = K.create('textarea[name="content"]', {
			allowFileManager : true
		});
	});

	KindEditor.ready(function(K) {
	window.editor = K.create('.process_sign_name',{resizeType: 0,allowFileManager: true,allowImageRemote:false,afterBlur: function(){this.sync();}});
	});
</script>
<style type="text/css">
	.mainBody div,span{
		font-size: 14px;
		color: #444444;
		 margin: 0 auto;
		 padding: 0;
	}
	
	.mainBody tr td{
		font-size: 12px;
		color: #444444;
	}
	.mainBody th{
		border: 1px solid #D3D3D3;
		background-color: #f1f9fe;
		font-size: 12px;
		color: #444444;
	}
	.mainBody td{
		 border: 1px solid #D3D3D3;
	}
</style>
</head>
<body class="easyui-layout">
	<!-- 北部面板 -->
	<!-- 北部面板结束 -->
	<!-- 中部面板 -->
	<form id="addleavefrm" method="post">
	<div class="mainBody" data-options="region:'center'">
	<volist name="data" id="vo">
		<table  style="width:100%;border: 1px solid #D3D3D3; border-collapse: collapse;">
			<caption>
				<h1>
					<eq name="goods" value="1">物品领用清单</eq>
					<eq name="goods" value="2">物品购买清单</eq>
					<eq name="goods" value="3">设施(设备)维修清单</eq>
				</h1>
			</caption>
			<tbody>
				<tr>
					<td style="width:16%; text-align: right; background-color: #f1f9fe; padding: 3px; border: 1px solid #D3D3D3; ">申请人：</td>
					<td style="text-align: left; width:50%;  padding: 3px; border: 1px solid #D3D3D3; " colspan="2">
							<input id="employe_name" name="employe_name" type="text" value="{$employeName}" readonly="readonly" /></td>
					<td style="width:16%; text-align: right; background-color: #f1f9fe; padding: 3px; border: 1px solid #D3D3D3; ">流程号：</td>
					<td style="text-align: left; width:50%;  padding: 3px; border: 1px solid #D3D3D3; " colspan="5">
						<volist name="processData" id="voo">
							<input class="process_num" name="process_num" readonly="readonly" value="{$voo.process_num}" /></td>
							<input type="hidden" name="process_now_id" value="{$voo.process_now_id}"/>
							<input type="hidden" name="process_id" value="{$voo.process_id}"/>
							<input type="hidden" name="process_title" value="{$voo.process_title}" />
							<input type="hidden" name="process_begin_id" value="{$voo.process_begin_id}" />
							<input type="hidden" name="process_time" value="{$voo.process_time}" />
							<input type="hidden" name="process_type" value="{$voo.process_type}" />
						</volist>
				</tr>
				<tr>
					<td style="width:16%; text-align: right; background-color: #f1f9fe; padding: 3px; border: 1px solid #D3D3D3; ">职位：</td>
					<td style="text-align: left; width:80%;  padding: 3px; border: 1px solid #D3D3D3; " colspan="2">
						<input id="position" name="leave_position" type="text" value="{$position}" readonly="readonly" />
					</td>
					<td style="width:16%; text-align: right; background-color: #f1f9fe; padding: 3px; border: 1px solid #D3D3D3; ">部门：</td>
					<td style="text-align: left; width:80%;  padding: 3px; border: 1px solid #D3D3D3; " colspan="5">
						<input id="dpt_name" name="dpt_name" type="text" value="{$department}" readonly="readonly" />
					</td>
				</tr>
			</tbody>
		</table>
		
		<eq name="goods" value="1">
			<table  style="width:100%;border: 1px solid #D3D3D3; border-collapse: collapse;">
				<thead>
					<tr>
						<td align="center">名称</td>
						<td align="center">数量</td>
						<td align="center">用途</td>
					</tr>
					<volist name="getgoodsData" id="vo">
						<tr>
							<td align="center">{$vo.getgoods_name}</td>
							<td align="center">{$vo.getgoods_count}</td>
							<td align="center">{$vo.getgoods_use}</td>
						</tr>
					</volist>
				</thead>
			</table>
		</eq>
		
		<eq name="goods" value="2">
			<table  style="width:100%;border: 1px solid #D3D3D3; border-collapse: collapse;">
				<thead>
					<tr>
						<td align="center">名称</td>
						<td align="center">数量</td>
						<td align="center">单价</td>
						<td align="center">用途</td>
					</tr>
					<volist name="buygoodsData" id="vo">
						<tr>
							<td align="center">{$vo.buygoods_name}</td>
							<td align="center">{$vo.buygoods_count}</td>
							<td align="center">{$vo.buygoods_price}</td>
							<td align="center">{$vo.buygoods_use}</td>
						</tr>
					</volist>
				</thead>
			</table>
		</eq>

		<eq name="goods" value="3">
			<table  style="width:100%;border: 1px solid #D3D3D3; border-collapse: collapse;">
				<thead>
					<tr>
						<td align="center">维修项目</td>
						<td align="center">数量</td>
						<td align="center">规格</td>
						<td align="center">单价</td>
						<td align="center">用途</td>
					</tr>
					<volist name="repairData" id="vo">
						<tr>
							<td align="center">{$vo.repair_name}</td>
							<td align="center">{$vo.repair_count}</td>
							<td align="center">{$vo.repair_specifications}</td>
							<td align="center">{$vo.repair_price}</td>
							<td align="center">{$vo.repair_use}</td>
						</tr>
					</volist>
				</thead>
			</table>
		</eq>

				<volist name="allApprovalData" id="voo">
					<div id="nextStepSet" style="padding-top: 10px;" class="noprint">
						<div class="title">审批记录</div>
						<div id="nextStepCont">
							<table class="editTable" style="width:100%;border: 1px solid #D3D3D3">
								<tbody>
									<tr style="border: 1px solid #D3D3D3;">
										<th style="border: 1px solid #D3D3D3; background-color: #f1f9fe; ">审批人：</th>
										<td style=" border: 1px solid #D3D3D3;">
												<span style="margin-left: 15px;">
													{$voo.employe_name}
												</span>
												<input type="hidden" id="employe_phone" name="employe_phone" value="{$voo.employe_phone}"/>
										</td>
										<th style="border: 1px solid #D3D3D3; background-color: #f1f9fe; ">审批意见：</th>
										<td style=" border: 1px solid #D3D3D3;">
												<span style="margin-left: 15px;">
													<eq name="voo.process_approval" value="1">批准</eq>
													<eq name="voo.process_approval" value="0">不予批准</eq>
													<eq name="voo.process_approval" value="">还未审批</eq>
												</span>
												<eq name="detail" value="true">
													<eq name="voo.process_now_id_if_approval" value="0">
														<input type="hidden" id="msg_to" value="{$voo.process_now_id}"/>
														
														<input type="hidden" id="msg_title" value="{$voo.process_title}"/>
														<input type="hidden" id="msg_content" value="您还有未完成的审批，请审批下"/>
														<a href="javascript:void(0);" id="msgUrge" class="easyui-linkbutton">消息催促</a>
														<a href="javascript:void(0);" id="msmUrge" class="easyui-linkbutton">短信催促</a>
													</eq>
												</eq>
										</td>
										
										<th style="border: 1px solid #D3D3D3; background-color: #f1f9fe; ">审批时间：</th>
										<td style=" border: 1px solid #D3D3D3;">
												<span style="margin-left: 15px;">
													{$voo.process_time|date="Y-m-d H:i:s",###}
												</span>
										</td>
									</tr> 
									<tr>
										<td style="width:16%; text-align: right; background-color: #f1f9fe; padding: 3px; border: 1px solid #D3D3D3; ">备注：</td>
										<td style="text-align: left; width:80%;  padding: 3px; border: 1px solid #D3D3D3; " colspan="5">
											<textarea style="width:90%;height:40px;" readonly="readonly">{$voo.process_remark}</textarea>
										</td>
									</tr>
									<tr>
										<td style="width:16%; text-align: right; background-color: #f1f9fe; padding: 3px; border: 1px solid #D3D3D3; ">领导签名：</td>
										<td style="text-align: left; width:80%;  padding: 3px; border: 1px solid #D3D3D3; " colspan="5">
											<textarea class="process_sign_name" style="width:100%;height:40px;" readonly="readonly">{$voo.process_sign_name}</textarea>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
					</div>
				</volist>
			</volist>

			<neq name="detail" value="true">
				<div id="nextStepSet" style="padding-top: 10px;" class="noprint">
					<div class="title">审批</div>

					<div id="nextStepCont">
						<table class="editTable" style="width:100%;border: 1px solid #D3D3D3">
							<tbody>
								<tr style="border: 1px solid #D3D3D3;">
									<th style="border: 1px solid #D3D3D3; background-color: #f1f9fe; ">审批意见：</th>
									<td style=" border: 1px solid #D3D3D3;">
											<span style="margin-left: 15px;">
												<input name="process_approval" type="radio" value="1" checked="true" />批准</span>
											<span style="margin-left: 15px;">
												<input name="process_approval" type="radio" value="0" />不予批准</span>
									</td>
								</tr> 
								<tr>
									<td style="width:16%; text-align: right; background-color: #f1f9fe; padding: 3px; border: 1px solid #D3D3D3; ">备注：</td>
									<td style="text-align: left; width:80%;  padding: 3px; border: 1px solid #D3D3D3; " colspan="5">
										<textarea id="process_remark" name="process_remark" style="width:90%;height:40px;"></textarea>
									</td>
								</tr>
								<tr>
									<td style="width:16%; text-align: right; background-color: #f1f9fe; padding: 3px; border: 1px solid #D3D3D3; ">领导签名：</td>
									<td style="text-align: left; width:80%;  padding: 3px; border: 1px solid #D3D3D3; " colspan="5">
										<textarea class="process_sign_name" name="process_sign_name" style="width:100%;height:40px;"></textarea>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>


				<neq name="sign" value="over">
				<div id="nextStepSet" style="padding-top: 10px;" class="noprint">
					<div class="title">下一步任务设置</div>
					<div id="nextStepCont">
						<table class="editTable" style="width:100%;border: 1px solid #D3D3D3">
							<tbody>
								<tr style="border: 1px solid #D3D3D3;">
									<th style="border: 1px solid #D3D3D3;">任务执行人：</th>
									<td style=" border: 1px solid #D3D3D3;">
										<span id="noper_420">
											<input id="oper_420" value="" type="hidden">
											<input readonly="readonly" id="check_person" class="easyui-validatebox" name="check_person" onclick="doSearch()" type="text" data-options="required:true">
											<input type="hidden" id="check_person_id" name="check_person_id"/>
											<span style="margin-left: 15px;">
												<input id="msg_tip" name="msg_tip" checked="checked" type="checkbox">消息提醒</span>
											<span style="margin-left: 15px;">
												<input id="msg_phone" name="msg_phone" type="checkbox">手机提醒</span>
										</span>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
				<include file="Common:checkPerson"/>
				</neq>
				<div style="width:100%;text-align: center; margin-top:20px;">
					<input type="submit" value="审批"/>
				</div>
			</neq>

	</div></form>
	<!-- 中部面板结束 -->
	<include file="Common:checkPerson"/>
</body>
</html>